import request from '@/utils/request'
import {timeFormat} from '@/utils/dateUtil'
const api = {
  userTypeMap:{1:'法人',2:'自然人',3:'后台用户'}
}

//登录日志列表查询
 api.getLogList = data => {
    let p = request({
      url: `/log/loginRecord/query`,
      method: 'get',
      params: data
    })
    p = p.then(res=>{
      let page = res.data.page
      page.list.forEach(e => {
        e.loginTime = timeFormat(e.loginTime)
        e.userType = api.userTypeMap[e.userType]
      });
      return page
    })
    return p
  }
  
  export default api